package com.chy.order_meal.controller;

import com.chy.order_meal.bean.ChyResponse;
import com.chy.order_meal.po.Exhibition;
import com.chy.order_meal.service.ExihibitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class ExihibitionController {

    @Autowired
    public ExihibitionService service;


    @GetMapping("/banner/get")
    @ResponseBody
    public ChyResponse getBanner(){
        try{
            List<Exhibition> data = service.getBanner();
            return ChyResponse.simpSuccess(data);
        }catch (Exception e){
            e.printStackTrace();
            return new ChyResponse(false,"获取1数据失败",null);
        }
    }
}
